package com.javabi.unix.parser.meminfo;

import com.javabi.unix.delimited.DelimitedLineProcessor;

public class MemInfoParser extends DelimitedLineProcessor<MemInfo> {

	private MemInfo info = new MemInfo();

	public MemInfoParser() {
		super(":");

	}

	@Override
	public MemInfo getResult() {
		if (info.isEmpty()) {
			throw new IllegalStateException("result not parsed");
		}
		return info;
	}

	@Override
	public boolean processLine(String key, String value, int number) {
		info.put(key, value);
		return false;
	}

}
